package com.itheima.Demo01.demo05S;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Callable05Test {
    public static void main(String[] args)  {
        MyCallable05S M = new MyCallable05S();
        MyCallable05S M2 = new MyCallable05S();
        MyCallable05S M3 = new MyCallable05S();

        FutureTask<String> ft = new FutureTask<>(M);
        FutureTask<String> ft2 = new FutureTask<>(M2);
        FutureTask<String> ft3 = new FutureTask<>(M3);

        Thread T1 = new Thread(ft);
        Thread T2 = new Thread(ft2);
        Thread T3 = new Thread(ft3);
        T1.setName("窗口一在卖票");
        T2.setName("窗口二在卖票");
        T3.setName("窗口三在卖票");
        T1.start();
        T2.start();
        T3.start();

//        String s = ft.get();
//        String s2 = ft2.get();
//        String s3 = ft3.get();
//
//        System.out.println(s);
//        System.out.println(s2);
//        System.out.println(s3);


    }
}
